package com.shensi.api.pay.client;


import com.shensi.api.pay.pojo.FleetCardSubForm;
import com.shensi.common.core.constant.CloudConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


@Api(tags = "车队子卡信息管理")
@FeignClient(name = CloudConstant.PAY_SERVER, path = "/fleetCardSub")
public interface FleetCardSubClient {

    @GetMapping(value = "/enterpriseId/{enterpriseId}/userId/{userId}")
    @ApiOperation(value = "根据用户id获取车队子卡信息", httpMethod = "GET", notes = "根据用户id获取车队子卡信息")
    public String getFleetCardSub(@PathVariable("enterpriseId") Long enterpriseId, @PathVariable("userId") Integer userId) ;

    @PostMapping(value = "/apply")
    @ApiOperation(value = "申请加入主卡", httpMethod = "POST", notes = "申请加入主卡")
    public String apply(@Valid @RequestBody FleetCardSubForm fleetCardSubForm) ;


    @DeleteMapping(value = "/unbind/{id}")
    @ApiOperation(value = "解除绑定", httpMethod = "DELETE", notes = "解除绑定")
    @ApiImplicitParam(paramType = "path", name = "id", value = "子卡id", required = true)
    public String unbind(@PathVariable("id") Long id) ;
}
